Repository navigation
FIX: Reuse the predefined offsetof instead of raising #error - #1050
Merged
Merged
Conversation
jhpark816
approved these changes
Nov 16, 2026
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issue
⌨️ What I did
문제
최신 Ubuntu(24.04, glibc 2.39)에서
--enable-persistence옵션으로 빌드하면,cmdlogrec.c를 컴파일하는 단계에서 아래와 같이 실패합니다.CI는
--enable-persistence없이 빌드하기 때문에 이 문제가 잡히지 않았고, 로컬에서 persistence를 켜고 테스트하다가 발견했습니다.원인
cmdlogrec.c는offsetof를 직접 정의해서 쓰는데, 이미 정의돼 있으면#error로 빌드를 멈추도록 되어 있었습니다.glibc 2.37부터
<sys/un.h>가<stddef.h>를 include하면서offsetof가 먼저 정의됩니다. (glibc c15318b)cmdlogrec.c도config_static.h를 거쳐 이 헤더를 include하기 때문에#error에 걸립니다.수정
이미 정의돼 있어도 에러를 내지 않도록
#ifdef+#error를#ifndef로 바꿨습니다.